/*
 * $Id: BlockModelType.java 57 2009-05-13 05:04:03Z donbeave $
 */

package labour.concept.client.data;

import com.extjs.gxt.ui.client.data.DataField;
import com.extjs.gxt.ui.client.data.ModelType;

public class BlockModelType extends ModelType {

  public BlockModelType() {
    setRoot("data");
    this.setTotalName("totalCount");

    addFields();
  }

  protected void addFields() {
    DataField field = new DataField("ID");
    field.setType(Integer.class);
    addField(field);

    field = new DataField("DataTypeID");
    field.setType(Integer.class);
    addField(field);

    field = new DataField("ProcessID");
    field.setType(Integer.class);
    addField(field);

    field = new DataField("IsNotEmpty");
    field.setType(Boolean.class);
    addField(field);

    field = new DataField("IsShared");
    field.setType(Boolean.class);
    addField(field);

    field = new DataField("IsPublished");
    field.setType(Boolean.class);
    addField(field);

// TODO возможно сделать доп. опцию, которая бы не использовала эти поля
/*
    if (true) {
      field = new DataField("ObjectID");
      field.setType(Integer.class);
      addField(field);

      field = new DataField("parentBlockID");
      field.setType(Integer.class);
      addField(field);

      field = new DataField("childsCount");
      field.setType(Integer.class);
      addField(field);
    }
*/

    addField("DateUpdate");
    addField("Name");
    addField("Description");
//    addField("Params");
    addField("Data");
  }

}
